<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="前端," />





  <link rel="alternate" href="/atom.xml" title="Mr.赵" type="application/atom+xml" />






<meta name="description" content="我挺可怜昨晚那个男生的，毕竟我曾经和他一样无助">
<meta name="keywords" content="前端">
<meta property="og:type" content="article">
<meta property="og:title" content="HTML">
<meta property="og:url" content="https://GodPang.github.io/2019/05/01/HTML/index.html">
<meta property="og:site_name" content="Mr.赵">
<meta property="og:description" content="我挺可怜昨晚那个男生的，毕竟我曾经和他一样无助">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://ww1.sinaimg.cn/large/006doHETly1g2ll97o7ppj30id0atq6p.jpg">
<meta property="og:image" content="http://ww1.sinaimg.cn/large/006doHETly1g2ll8si118j30cb071dgc.jpg">
<meta property="og:image" content="http://ww1.sinaimg.cn/large/006doHETly1g2lla27l3uj30mw09bacn.jpg">
<meta property="og:image" content="https://godpang.github.io/2019/05/01/HTML/”logo.gif”">
<meta property="og:image" content="https://godpang.github.io/2019/05/01/HTML/”img/img01/logo.gif”">
<meta property="og:image" content="https://godpang.github.io/2019/05/01/HTML/”../logo.gif”">
<meta property="og:image" content="http://ww1.sinaimg.cn/large/006doHETly1g2llavtvk9j30jv066myd.jpg">
<meta property="og:image" content="http://ww1.sinaimg.cn/large/006doHETly1g2llcmau9sj30ha060adq.jpg">
<meta property="og:updated_time" content="2019-05-01T02:35:56.683Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="HTML">
<meta name="twitter:description" content="我挺可怜昨晚那个男生的，毕竟我曾经和他一样无助">
<meta name="twitter:image" content="http://ww1.sinaimg.cn/large/006doHETly1g2ll97o7ppj30id0atq6p.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://GodPang.github.io/2019/05/01/HTML/"/>





  <title>HTML | Mr.赵</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>
    
    <a href="https://GodPang.github.io" class="github-corner" aria-label="View source on Github"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Mr.赵</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-首页">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-关于">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-标签">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-类别">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            类别
          </a>
        </li>
      
        
        <li class="menu-item menu-item-归档">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://GodPang.github.io/2019/05/01/HTML/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="GodPang">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/touxiang.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Mr.赵">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">HTML</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-05-01T10:11:47+08:00">
                2019-05-01
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/web学习/" itemprop="url" rel="index">
                    <span itemprop="name">web学习</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/2019/05/01/HTML/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count valine-comment-count" data-xid="/2019/05/01/HTML/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          

          
            <span class="post-meta-divider">|</span>
            <span class="page-pv"><i class="fa fa-eye"></i>
            <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>
            </span>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <html><head></head><body><h3>我挺可怜昨晚那个男生的，毕竟我曾经和他一样无助</h3>
<a id="more"></a>
# 一、HTML语言

<h2 id="1、什么是HTML语言"><a href="#1、什么是HTML语言" class="headerlink" title="1、什么是HTML语言"></a>1、什么是HTML语言</h2><p>HTML（英文Hyper Text Markup Language的缩写）中文译为“超文本标签语言”，主要是通过HTML标签对网页中的文本、图片、声音等内容进行描述。</p>
<p>  标签：标记的意思，在日常生活中，我们也经常会见到一些标记，例如交通规则的标记，告诉你应该怎样走。</p>
<p>而这里的标签就是告诉浏览器，在网页上显示什么内容，例如图片，文字，视频等。</p>
<p>文本：文字，那么什么是”超文本“，不仅可以显示文字，而且可以显示出图片，视频等，并且可以对文字，图片加上链接（所谓链接，就是单击一下，可以打开别的页面。）。</p>
<h2 id="2、网页创建"><a href="#2、网页创建" class="headerlink" title="2、网页创建"></a>2、网页创建</h2><p>了解了什么是HTML以后，怎样使用HTML编写网页呢？</p>
<p>先创建一个记事本文件，然后重命名，格式为.html。用记事本工具编写，比较麻烦，这里可以写一个标记，演示一下，同时也说清楚了什么是标记。</p>
<p>我们可以用一下其它的工具来编写，提供相应的代码提示。</p>
<h3 id="2-1-常用工具"><a href="#2-1-常用工具" class="headerlink" title="2.1 常用工具"></a>2.1 常用工具</h3><p><img src="http://ww1.sinaimg.cn/large/006doHETly1g2ll97o7ppj30id0atq6p.jpg" alt></p>
<h3 id="2-2-Html基本结构"><a href="#2-2-Html基本结构" class="headerlink" title="2.2  Html基本结构"></a>2.2  Html基本结构</h3><p><img src="http://ww1.sinaimg.cn/large/006doHETly1g2ll8si118j30cb071dgc.jpg" alt></p>
<figure class="highlight plain"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">说明：</span><br><span class="line">1、<html>标签的作用是所有HTML中标签的一个根节点。</span><br><span class="line">2、<head> 头部标签，在头部标签中我们必须设置的标签是<title>标签</span><br><span class="line">3、<title> 标签设置网页的标题</span><br><span class="line">4、<body> 页面在的主体部分，用于存放所有的HTML标签</span><br></pre></td></tr></tbody></table></figure>

<p><strong>这个结构要记住。</strong></p>
<p>注意：在使用sublime进行演示时，最开始敲完后不要敲回车键，否则会自动填充整个代码。</p>
<p>通过整个HTML结构我们可以看出来，标签之间都是有关系的。</p>
<title>在<head><meta name="generator" content="Hexo 3.9.0">里面，而<head><meta name="generator" content="Hexo 3.9.0">和</head></head><body>是并列的。



<h3 id="2-3-标签关系"><a href="#2-3-标签关系" class="headerlink" title="2.3 标签关系"></a>2.3 标签关系</h3><p>​   标签的相互关系就分为两种：</p>
<p>1.嵌套关系</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><head>  <title> </title>  </head></span><br></pre></td></tr></table></figure>

<p>2.并列关系</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><head></head></span><br><span class="line"><body></body></span><br></pre></td></tr></table></figure>

<p> 建议： 如果两个标签之间的关系是嵌套关系，子元素最好缩进一个tab键的身位。如果是并列关系，最好上下对齐。</p>
<p>我们发现在手敲上面的代码的时候，会比较麻烦，所以可以如下的快速输入方式：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">再页面中输入 以下2个单词</span><br><span class="line"></span><br><span class="line">1. html: 5</span><br><span class="line">2. !</span><br><span class="line">      在sublime里面然后按下tab键盘即可生成HTML骨架</span><br></pre></td></tr></table></figure>

<h3 id="2-4-文档类型-lt-DOCTYPE-gt"><a href="#2-4-文档类型-lt-DOCTYPE-gt" class="headerlink" title="2.4  文档类型<!DOCTYPE>"></a>2.4  文档类型<!DOCTYPE></h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><!DOCTYPE html></span><br></pre></td></tr></table></figure>

<p>这句话就是告诉我们使用哪个html版本？  我们使用的是 html 5 的版本。  html有很多版本，那我们应该告诉用户和浏览器我们使用的版本号。</p>
<h3 id="2-5-字符集"><a href="#2-5-字符集" class="headerlink" title="2.5 字符集"></a>2.5 字符集</h3><meta charset="UTF-8">

<p>utf-8是目前最常用的字符集编码方式，常用的字符集编码方式还有gbk和gb2312。</p>
<p>gb2312 简单中文  包括6763个汉字</p>
<p>BIG5   繁体中文 港澳台等用</p>
<p>GBK包含全部中文字符    是GB2312的扩展，加入对繁体字的支持，兼容GB2312</p>
<p>UTF-8则包含全世界所有国家需要用到的字符</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">记住一点，以后我们统统使用UTF-8 字符集, 这样就避免出现字符集不统一而引起乱码的情况了。</span><br></pre></td></tr></table></figure>

<h1 id="二、HTML常用标签"><a href="#二、HTML常用标签" class="headerlink" title="二、HTML常用标签"></a>二、HTML常用标签</h1><p>我们学习HTML，最主要的就是用来学习标签</p>
<h2 id="1、排版标签"><a href="#1、排版标签" class="headerlink" title="1、排版标签"></a>1、排版标签</h2><p>排版标签主要和css搭配使用，显示网页结构的标签，是网页布局最常用的标签。</p>
<h3 id="1-1-标题标签-熟记"><a href="#1-1-标题标签-熟记" class="headerlink" title="1.1 标题标签 (熟记)"></a>1.1 标题标签 (熟记)</h3><p>​   我们经常会在页面中用到标题标签，HTML提供了6个等级的标题，即</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><h1>、<h2>、<h3>、<h4>、<h5>和<h6></span><br><span class="line"></span><br><span class="line"> <h1>用来修饰网页的主标题，<h2>表示一个段落的标题，<h3>表示段落的小节标题</span><br></pre></td></tr></table></figure>

<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">标题标签语义：  作为标题使用，并且依据重要性递减</span><br></pre></td></tr></table></figure>

<p>​   其基本语法格式如下：</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">hn</span>></span>   标题文本   <span class="tag"></<span class="name">hn</span>></span></span><br></pre></td></tr></table></figure>

<p>H1标签最常见的使用方法是用在logo上，如果我们要把H1标签使用在logo上，那么我们记得为图片添加alt标签以及a链接来指向首页，因为蜘蛛是无法识别图片的，所以我们要用alt标签来解释图片的意思。</p>
<h3 id="1-2-段落标签-熟记"><a href="#1-2-段落标签-熟记" class="headerlink" title="1.2 段落标签( 熟记)"></a>1.2 段落标签( 熟记)</h3><p>单词缩写：  paragraph  段落</p>
<p> 在网页中要把文字有条理地显示出来，离不开段落标签，就如同我们平常写文章一样，整个网页也可以分为若干个段落，而段落的标签就是</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">p</span>></span>  文本内容  <span class="tag"></<span class="name">p</span>></span></span><br></pre></td></tr></table></figure>

<p>是HTML文档中最常见的标签，默认情况下，文本在一个段落中会根据浏览器窗口的大小自动换行。</p>
<h3 id="1-3-水平线标签-认识"><a href="#1-3-水平线标签-认识" class="headerlink" title="1.3 水平线标签(认识)"></a>1.3 水平线标签(认识)</h3><p>单词缩写：  horizontal  横线</p>
<p>在网页中常常看到一些水平线将段落与段落之间隔开，使得文档结构清晰，层次分明。这些水平线可以通过插入图片实现，也可以简单地通过标签来完成，<hr>就是创建横跨网页水平线的标签。其基本语法格式如下：</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">hr</span> /></span>是单标签</span><br></pre></td></tr></table></figure>

<p> 在网页中显示默认样式的水平线。建议在hr与/之间加上空格。</p>
<h4 id="1-3-1-标签属性"><a href="#1-3-1-标签属性" class="headerlink" title="1.3.1 标签属性"></a>1.3.1 标签属性</h4><p>属性就是特性 比如 手机的颜色 手机的尺寸 ，总结就是手机的。。</p>
<p>使用HTML制作网页时，如果想让HTML标签提供更多的信息，可以使用HTML标签的属性加以设置。其基本语法格式如下：</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">标签名</span> 属性<span class="attr">1</span>=<span class="string">"属性值1"</span> 属性<span class="attr">2</span>=<span class="string">"属性值2"</span> …></span> 内容 <span class="tag"></<span class="name">标签名</span>></span></span><br></pre></td></tr></table></figure>

<p>在上面的语法中，</p>
<p>1.标签可以拥有多个属性，必须写在开始标签中，位于标签名后面。</p>
<p>2.属性之间不分先后顺序，标签名与属性、属性与属性之间均以空格分开。</p>
<p>3.任何标签的属性都有默认值，省略该属性则取默认值。</p>
<p>比如:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><hr width="400" /></span><br></pre></td></tr></table></figure>

<h3 id="1-4-HTML标签分类"><a href="#1-4-HTML标签分类" class="headerlink" title="1.4  HTML标签分类"></a>1.4  HTML标签分类</h3><p>  在HTML页面中，带有“< >”符号的元素被称为HTML标签，如上面提到的 <HTML>、<head>、<body>都是HTML标签。所谓标签就是放在“< >” 标签符中表示某个功能的编码命令，也称为HTML标签或 HTML元素</p>
<p>1.双标签</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">标签名</span>></span> 内容 <span class="tag"></<span class="name">标签名</span>></span></span><br></pre></td></tr></table></figure>

<p>该语法中“<标签名>”表示该标签的作用开始，一般称为“开始标签（start tag）”，“</标签名>” 表示该标签的作用结束，一般称为“结束标签（end tag）”。和开始标签相比，结束标签只是在前面加了一个关闭符“/”。</p>
<blockquote>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">> 比如 <span class="tag"><<span class="name">body</span>></span>我是文字  <span class="tag"></<span class="name">body</span>></span></span><br><span class="line">></span><br></pre></td></tr></table></figure>
</blockquote>
<p>2.单标签</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">标签名</span> /></span></span><br></pre></td></tr></table></figure>

<p>  单标签也称空标签，是指用一个标签符号即可完整地描述某个功能的标签。</p>
<h3 id="1-5-换行标签-熟记"><a href="#1-5-换行标签-熟记" class="headerlink" title="1.5 换行标签(熟记)"></a>1.5 换行标签(熟记)</h3><p>单词缩写：  break   打断 ,换行</p>
<p>在HTML中，一个段落中的文字会从左到右依次排列，直到浏览器窗口的右端，然后自动换行。如果希望某段文本强制换行显示，就需要使用换行标签</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">br</span> /></span></span><br></pre></td></tr></table></figure>

<p>这时如果还像在word中直接敲回车键换行就不起作用了。</p>
<h3 id="1-6-div-span标签-重点"><a href="#1-6-div-span标签-重点" class="headerlink" title="1.6 div span标签(重点)"></a>1.6 div span标签(重点)</h3><p>div  span    是没有语义的     是我们网页布局主要的2个盒子</p>
<p>div 就是  division  的缩写   分割， 分区的意思  其实有很多div 来组合网页。</p>
<p>  div是块级元素，都是独占一行。</p>
<p>span, 跨度，跨距；范围</p>
<p>span都是行内元素，都是在一行，主要用来展示文本。</p>
<p>语法格式：</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">div</span>></span> 这是头部 <span class="tag"></<span class="name">div</span>></span>    <span class="tag"><<span class="name">span</span>></span>今日价格<span class="tag"></<span class="name">span</span>></span></span><br></pre></td></tr></table></figure>

<h2 id="2、HTML标签的语义化"><a href="#2、HTML标签的语义化" class="headerlink" title="2、HTML标签的语义化"></a>2、HTML标签的语义化</h2><p>白话： 所谓标签语义化，就是指标签的含义。</p>
<h3 id="为什么要有语义化标签"><a href="#为什么要有语义化标签" class="headerlink" title="为什么要有语义化标签"></a>为什么要有语义化标签</h3><ol>
<li>方便代码的阅读和维护</li>
<li>同时让浏览器或是网络爬虫可以很好地解析，从而更好分析其中的内容</li>
<li>使用语义化标签会具有更好地搜索引擎优化 ，搜索引擎会认为权重比较高。</li>
</ol>
<p>核心：合适的地方给一个最为合理的标签。</p>
<h2 id="3、文本格式化标签-熟记"><a href="#3、文本格式化标签-熟记" class="headerlink" title="3、文本格式化标签(熟记)"></a>3、文本格式化标签(熟记)</h2><p>在网页中，有时需要为文字设置粗体、斜体或下划线效果，这时就需要用到HTML中的文本格式化标签，使文字以特殊的方式显示。</p>
<p>  b  i  s  u   只有使用 没有 强调的意思       strong   em  del   ins  语义更强烈</p>
<h2 id="4、图像标签img-重点"><a href="#4、图像标签img-重点" class="headerlink" title="4、图像标签img (重点)"></a>4、图像标签img (重点)</h2><p>单词缩写：   image  图像</p>
<p>HTML网页中任何元素的实现都要依靠HTML标签，要想在网页中显示图像就需要使用图像标签，接下来将详细介绍图像标签<img>以及和他相关的属性。其基本语法格式如下：</p>
<p>该语法中src属性用于指定图像文件的路径和文件名，他是img标签的必需属性。</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">img</span> <span class="attr">src</span>=<span class="string">"图像URL"</span> <span class="attr">class</span>=<span class="string">"css样式"</span>/></span></span><br></pre></td></tr></table></figure>

<p><img src="http://ww1.sinaimg.cn/large/006doHETly1g2lla27l3uj30mw09bacn.jpg" alt=""></p>
<h1 id="三、路径-重点、难点"><a href="#三、路径-重点、难点" class="headerlink" title="三、路径(重点、难点)"></a>三、路径(重点、难点)</h1><p>实际工作中，通常新建一个文件夹专门用于存放图像文件，这时再插入图像，就需要采用“路径”的方式来指定图像文件的位置。</p>
<p>路径可以分为： 相对路径和绝对路径</p>
<h2 id="1、相对路径"><a href="#1、相对路径" class="headerlink" title="1、相对路径"></a>1、相对路径</h2><ol>
<li>图像文件和HTML文件位于同一文件夹：只需输入图像文件的名称即可，如<img src=”logo.gif” />。</li>
<li>图像文件位于HTML文件的下一级文件夹：输入文件夹名和文件名，之间用“/”隔开，如<img src=”img/img01/logo.gif” />。</li>
<li>图像文件位于HTML文件的上一级文件夹：在文件名之前加入“../” ，如果是上两级，则需要使用 “../ ../”，以此类推，如<img src=”../logo.gif” />。</li>
</ol>
<h2 id="2、绝对路径"><a href="#2、绝对路径" class="headerlink" title="2、绝对路径"></a>2、绝对路径</h2><p>绝对路径</p>
<p>“D:\web\img\logo.gif”，或完整的网络地址，例如“<a href="http://www.itcast.cn/images/logo.gif”。" target="_blank" rel="noopener">http://www.itcast.cn/images/logo.gif”。</a></p>
<h1 id="四、链接标签-重点"><a href="#四、链接标签-重点" class="headerlink" title="四、链接标签(重点)"></a>四、链接标签(重点)</h1><p>单词缩写：  anchor 的缩写 。基本解释 锚, 铁锚 的</p>
<p>在HTML中创建超链接非常简单，只需用标签环绕需要被链接的对象即可，其基本语法格式如下：</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">a</span> <span class="attr">href</span>=<span class="string">"跳转目标"</span> <span class="attr">target</span>=<span class="string">"目标窗口的弹出方式"</span>></span>文本或图像<span class="tag"></<span class="name">a</span>></span></span><br></pre></td></tr></table></figure>

<p>href：用于指定链接目标的url地址，当为标签应用href属性时，它就具有了超链接的功能。  Hypertext Reference的缩写。意思是超文本引用</p>
<p>target：用于指定链接页面的打开方式，其取值有_self和_blank两种，其中_self为默认值，_blank为在新窗口中打开方式。</p>
<p>注意：</p>
<p>1.外部链接 需要添加 http:// <a href="http://www.baidu.com" target="_blank" rel="noopener">www.baidu.com</a></p>
<p>2.内部链接 直接链接内部页面名称即可 比如 < a href=”index.html”> 首页 </p>
<p>3.如果当时没有确定链接目标时，通常将链接标签的href属性值定义为“#”(即href=”#”)，表示该链接暂时为一个空链接。</p>
<p>4.不仅可以创建文本超链接，在网页中各种网页元素，如图像、表格、音频、视频等都可以添加超链接。</p>
<h2 id="1、base-标签"><a href="#1、base-标签" class="headerlink" title="1、base 标签"></a>1、base 标签</h2><p>base 可以设置整体链接的打开状态</p>
<p>base 写到  <head><meta name="generator" content="Hexo 3.9.0">  </head>  之间</p>
<h2 id="2、锚点定位-（难点）"><a href="#2、锚点定位-（难点）" class="headerlink" title="2、锚点定位 （难点）"></a>2、锚点定位 （难点）</h2><p>通过创建锚点链接，用户能够快速定位到目标内容。<br>创建锚点链接分为两步：</p>
<p>1.使用“a href=”#id名>“链接文本”创建链接文本。</p>
<p>2.使用相应的id名标注跳转目标的位置。</p>
<h1 id="五：CSS样式"><a href="#五：CSS样式" class="headerlink" title="五：CSS样式"></a>五：CSS样式</h1><h2 id="1、CSS初识"><a href="#1、CSS初识" class="headerlink" title="1、CSS初识"></a>1、CSS初识</h2><p>CSS(Cascading Style Sheets)</p>
<p>CSS通常称为CSS样式表或层叠样式表（级联样式表），主要用于设置HTML页面中的文本内容（字体、大小、对齐方式等）、图片的外形（宽高、边框样式、边距等）以及版面的布局等外观显示样式。</p>
<p>CSS以HTML为基础，提供了丰富的功能，如字体、颜色、背景的控制及整体排版等，而且还可以针对不同的浏览器设置不同的样式。</p>
<h2 id="2、CSS-网页的美容师"><a href="#2、CSS-网页的美容师" class="headerlink" title="2、CSS 网页的美容师"></a>2、CSS 网页的美容师</h2><p>CSS的出现，拯救了混乱的HTML，当让更加拯救了我们web开发者。 让我们的网页更加丰富多彩。</p>
<p>CSS的最大贡献就是：  让 HTML 从样式中解脱苦海，  实现了 HTML 专注去做 结构呈现。 而样式交给 CSS 后，你完全可以放心的早点洗洗睡了！</p>
<figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">![](.\图片\db.png)</span><br><span class="line"></span><br><span class="line">网页添加 CSS和不添加CSS 的对比：</span><br><span class="line"></span><br><span class="line">带有CSS的页面</span><br><span class="line"></span><br><span class="line">![](.\图片\Cc.png)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">没有CSS的页面</span><br><span class="line"></span><br><span class="line">![](.\图片\fff.png)</span><br></pre></td></tr></table></figure>

<h2 id="3、CSS样式规则"><a href="#3、CSS样式规则" class="headerlink" title="3、CSS样式规则"></a>3、CSS样式规则</h2><p>使用HTML时，需要遵从一定的规范。CSS亦如此，要想熟练地使用CSS对网页进行修饰，首先需要了解CSS样式规则，具体格式如下：</p>
<p><img src="http://ww1.sinaimg.cn/large/006doHETly1g2llavtvk9j30jv066myd.jpg" alt=""></p>
<h2 id="4-选择器（重点）"><a href="#4-选择器（重点）" class="headerlink" title="4:选择器（重点）"></a>4:选择器（重点）</h2><p>要想将CSS样式应用于特定的HTML元素，首先需要找到该目标元素。在CSS中，执行这一任务的样式规则部分被称为选择器（选择符）。</p>
<h3 id="4-1-标签选择器（元素选择器）"><a href="#4-1-标签选择器（元素选择器）" class="headerlink" title="4.1 标签选择器（元素选择器）"></a>4.1 标签选择器（元素选择器）</h3><p>标签选择器是指用HTML标签名称作为选择器，按标签名称分类，为页面中某一类标签指定统一的CSS样式。其基本语法格式如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">标签名{属性1:属性值1; 属性2:属性值2; 属性3:属性值3; }  或者</span><br><span class="line">元素名{属性1:属性值1; 属性2:属性值2; 属性3:属性值3; }</span><br></pre></td></tr></table></figure>

<p>标签选择器最大的优点是能快速为页面中同类型的标签统一样式，同时这也是他的缺点，不能设计差异化样式。</p>
<h3 id="4-2-类选择器"><a href="#4-2-类选择器" class="headerlink" title="4.2 类选择器"></a>4.2 类选择器</h3><p>类选择器使用“.”（英文点号）进行标识，后面紧跟类名，其基本语法格式如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.类名{属性1:属性值1; 属性2:属性值2; 属性3:属性值3; }</span><br></pre></td></tr></table></figure>

<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">标签调用的时候用 class=“类名”  即可。</span><br></pre></td></tr></table></figure>

<p>类选择器最大的优势是可以为元素对象定义单独或相同的样式。</p>
<figure class="highlight"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><!<span class="selector-tag">DOCTYPE</span> <span class="selector-tag">html</span>></span><br><span class="line"><<span class="selector-tag">html</span>></span><br><span class="line"><<span class="selector-tag">head</span>></span><br><span class="line">    <title>类选择器</title></span><br><span class="line">    <style type="text/css"></span><br><span class="line">    <span class="selector-class">.c-apple</span> {<span class="attribute">color</span>: red;}</span><br><span class="line">    <span class="selector-class">.banana</span> { <span class="attribute">color</span>: blue; }</span><br><span class="line">    <span class="selector-id">#blue</span> { <span class="attribute">color</span>:blue; }</span><br><span class="line">    </style></span><br><span class="line"></head></span><br><span class="line"><<span class="selector-tag">body</span>></span><br><span class="line">   <p class="c-apple">苹果</p></span><br><span class="line">   <p class="banana">橘子</p></span><br><span class="line">    <p class="c-apple">香蕉</p></span><br><span class="line">    <p id="blue">菠萝</p></span><br><span class="line"></body></span><br><span class="line"></html></span><br></pre></td></tr></table></figure>

<h3 id="4-3-选择器命名规范"><a href="#4-3-选择器命名规范" class="headerlink" title="4.3  选择器命名规范"></a>4.3  选择器命名规范</h3><p>1.长名称或词组可以使用中横线来为选择器命名。<br>2.不建议使用“_”下划线来命名CSS选择器。</p>
<p>​       能良好区分JavaScript变量命名(JS变量命名是用“_”)</p>
<p>3.不要纯数字、中文等命名， 尽量使用英文字母来表示。</p>
<h3 id="4-4-ID选择器"><a href="#4-4-ID选择器" class="headerlink" title="4.4 ID选择器"></a>4.4 ID选择器</h3><p>id选择器使用“#”进行标识，后面紧跟id名，其基本语法格式如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">#id名{属性1:属性值1; 属性2:属性值2; 属性3:属性值3; }</span><br></pre></td></tr></table></figure>

<p>该语法中，id名即为HTML元素的id属性值，大多数HTML元素都可以定义id属性，元素的id值是唯一的，只能对应于文档中某一个具体的元素。</p>
<p>用法基本和类选择器相同。</p>
<h3 id="4-5-类选择器与ID选择器区别"><a href="#4-5-类选择器与ID选择器区别" class="headerlink" title="4.5 类选择器与ID选择器区别"></a>4.5 类选择器与ID选择器区别</h3><p>在同一个页面内，不允许有相同名字的id对象出现，但是允许相同名字的class。</p>
<p>类选择器（class） 好比人的名字，  是可以多次重复使用的， 比如  张伟  王伟  李伟  李娜</p>
<p>id选择器     好比人的身份证号码，  全中国是唯一的， 不得重复。 只能使用一次。</p>
<p><em>id选择器和类选择器最大的不同在于 使用次数上。</em></p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">style</span> <span class="attr">type</span>=<span class="string">"text/css"</span>></span><span class="undefined"></span></span><br><span class="line"><span class="css">     <span class="selector-class">.fontSize</span>{</span></span><br><span class="line"><span class="undefined">        font-size: 25px;</span></span><br><span class="line"><span class="undefined">     }</span></span><br><span class="line"><span class="css">     <span class="selector-id">#blue</span>{</span></span><br><span class="line"><span class="undefined">        color: red;</span></span><br><span class="line"><span class="undefined">     }</span></span><br><span class="line"><span class="undefined">    </span><span class="tag"></<span class="name">style</span>></span></span><br><span class="line"><span class="tag"></<span class="name">head</span>></span></span><br><span class="line"><span class="tag"><<span class="name">body</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">p</span> <span class="attr">class</span>=<span class="string">"fontSize"</span>></span>张三<span class="tag"></<span class="name">p</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">p</span> <span class="attr">class</span>=<span class="string">"fontSize"</span>></span>李四<span class="tag"></<span class="name">p</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">p</span> <span class="attr">id</span>=<span class="string">"blue"</span>></span>王五<span class="tag"></<span class="name">p</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">p</span> <span class="attr">id</span>=<span class="string">"blue"</span>></span>马六<span class="tag"></<span class="name">p</span>></span></span><br><span class="line">    <span class="comment"><!-- 及时浏览器的兼容性比较好，使用多次id也能够显示，但是坚决不能使用id多次。 --></span></span><br><span class="line"></span><br><span class="line"><span class="tag"></<span class="name">body</span>></span></span><br><span class="line"><span class="tag"></<span class="name">html</span>></span></span><br></pre></td></tr></table></figure>

<h3 id="4-6-通配符选择器"><a href="#4-6-通配符选择器" class="headerlink" title="4.6 通配符选择器"></a>4.6 通配符选择器</h3><p>通配符选择器用“*”号表示，他是所有选择器中作用范围最广的，能匹配页面中所有的元素。其基本语法格式如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">* { 属性1:属性值1; 属性2:属性值2; 属性3:属性值3; }</span><br></pre></td></tr></table></figure>

<p>例如下面的代码，使用通配符选择器定义CSS样式，清除所有HTML标记的默认边距。</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">* {</span><br><span class="line">  <span class="attribute">margin</span>: <span class="number">0</span>;                    <span class="comment">/* 定义外边距*/</span></span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">0</span>;                   <span class="comment">/* 定义内边距*/</span></span><br><span class="line">  }</span><br></pre></td></tr></table></figure>

<h3 id="4-7-案例"><a href="#4-7-案例" class="headerlink" title="4.7 案例"></a>4.7 案例</h3><p>制作一个完善的新闻详情页面。</p>
<p>第一步：我们首先通过HTML来进行网页结构的设计</p>
<p>第二：通过CSS样式来进行相应的美化。</p>
<p>在这个案例中，我们会讲解几个关于文本修饰的样式。</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">text-align</span>: <span class="selector-tag">center</span>;  <span class="comment">/*让文本居中显示*/</span></span><br><span class="line"><span class="selector-tag">text-indent</span>: 2<span class="selector-tag">em</span>; <span class="comment">/*首行缩进2个字*/</span></span><br><span class="line"><span class="selector-tag">font-weight</span>: <span class="selector-tag">bolder</span>; <span class="comment">/* 对文字进行加错*/</span></span><br></pre></td></tr></table></figure>

<p>具体案例如下：</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta"><!DOCTYPE html></span></span><br><span class="line"><span class="tag"><<span class="name">html</span> <span class="attr">lang</span>=<span class="string">"en"</span>></span></span><br><span class="line"><span class="tag"><<span class="name">head</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">meta</span> <span class="attr">charset</span>=<span class="string">"UTF-8"</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">title</span>></span>新闻详情页面<span class="tag"></<span class="name">title</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">style</span> <span class="attr">type</span>=<span class="string">"text/css"</span>></span><span class="undefined"></span></span><br><span class="line"><span class="undefined">        h1 {</span></span><br><span class="line"><span class="undefined">            font-size: 25px;</span></span><br><span class="line"><span class="css">            <span class="selector-tag">text-align</span>: <span class="selector-tag">center</span>;  <span class="comment">/*让文本居中显示*/</span></span></span><br><span class="line"><span class="undefined">        }</span></span><br><span class="line"><span class="undefined">        div {</span></span><br><span class="line"><span class="undefined">            font-size: 14px;</span></span><br><span class="line"><span class="undefined">            text-align: center;</span></span><br><span class="line"><span class="undefined">        }</span></span><br><span class="line"><span class="undefined">        p {</span></span><br><span class="line"><span class="undefined">            font-size: 14px;</span></span><br><span class="line"><span class="undefined">            line-height: 22px;</span></span><br><span class="line"><span class="css">            <span class="selector-tag">text-indent</span>: 2<span class="selector-tag">em</span>; <span class="comment">/*首行缩进2个字*/</span></span></span><br><span class="line"><span class="undefined">        }</span></span><br><span class="line"><span class="css">        <span class="selector-class">.sports</span>{</span></span><br><span class="line"><span class="undefined">            color: red;</span></span><br><span class="line"><span class="undefined">        }</span></span><br><span class="line"><span class="css">        <span class="selector-class">.co</span>{</span></span><br><span class="line"><span class="css">            <span class="selector-tag">color</span>:<span class="selector-id">#ccc</span>;</span></span><br><span class="line"><span class="undefined">            font-weight: bolder;</span></span><br><span class="line"><span class="undefined">        }</span></span><br><span class="line"><span class="undefined"></span></span><br><span class="line"><span class="undefined">    </span><span class="tag"></<span class="name">style</span>></span></span><br><span class="line"><span class="tag"></<span class="name">head</span>></span></span><br><span class="line"><span class="tag"><<span class="name">body</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">h1</span>></span>中乙队赛前突然换帅仍胜毅腾 高原黑马欲阻击舜天<span class="tag"></<span class="name">h1</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">div</span>></span>2017年07月16日20:11 <span class="tag"><<span class="name">span</span> <span class="attr">class</span>=<span class="string">"sports"</span>></span>新浪体育 评论中大奖<span class="tag"></<span class="name">span</span>></span>（11人参与）<span class="tag"><<span class="name">span</span> <span class="attr">class</span>=<span class="string">"co"</span>></span>收藏本文<span class="tag"></<span class="name">span</span>></span><span class="tag"></<span class="name">div</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">hr</span> /></span></span><br><span class="line">    <span class="tag"><<span class="name">p</span>></span>新浪体育讯　7月16日是燕京啤酒[微博]2017中国足协杯第三轮比赛，丽江嘉云昊队主场迎战哈尔滨毅腾队的比赛日。然而就在比赛日中午，丽江嘉云昊队主帅李虎和另外两名成员悄然向俱乐部提出了辞呈，并且收拾行囊准备离开。在这样的情况下，丽江嘉云昊队不得不由此前的教练员杨贵东代理指挥了本场比赛。<span class="tag"></<span class="name">p</span>></span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="tag"><<span class="name">p</span>></span>在昨日丽江嘉云昊队主帅李虎就缺席了赛前的新闻发布会，当时俱乐部给出的解释是李虎由于身体欠佳，去医院接受治疗。然而今日李虎出现在俱乐部时，向记者否认了这一说法，并且坦言已经向俱乐部提出了辞呈。<span class="tag"></<span class="name">p</span>></span></span><br><span class="line"></span><br><span class="line"><span class="tag"><<span class="name">p</span>></span>据记者多方了解的情况，李虎[微博]极其教练组近来在执教成绩上承受了不小的压力，在联赛间歇期期间，教练组曾向俱乐部提出能够多引进有实力的球员补强球队，然而由于和俱乐部在投入以及成绩指标上的分歧，李虎最终和教练组一起在比赛日辞职。<span class="tag"></<span class="name">p</span>></span></span><br><span class="line"></span><br><span class="line"><span class="tag"><<span class="name">p</span>></span>这样的情况并没有影响到丽江嘉云昊队[微博]的队员，在比赛中丽江队在主场拼的非常凶，在暴雨之中仍然发挥出了体能充沛的优势，最终凭借点球击败了中超球队哈尔滨毅腾，顺利晋级下一轮比赛。根据中国足协杯的赛程，丽江嘉云昊队将在本月23日迎战江苏舜天队。<span class="tag"></<span class="name">p</span>></span></span><br><span class="line">    <span class="tag"></<span class="name">body</span>></span></span><br><span class="line"></span><br><span class="line"><span class="tag"></<span class="name">body</span>></span></span><br><span class="line"><span class="tag"></<span class="name">html</span>></span></span><br></pre></td></tr></table></figure>

<h3 id="4-8-后代选择器"><a href="#4-8-后代选择器" class="headerlink" title="4.8 后代选择器"></a>4.8 后代选择器</h3><p>后代选择器又称为包含选择器，用来选择元素或元素组的后代，其写法就是把外层标签写在前面，内层标签写在后面，中间用空格分隔。当标签发生嵌套时，内层标签就成为外层标签的后代。</p>
<p><img src="http://ww1.sinaimg.cn/large/006doHETly1g2llcmau9sj30ha060adq.jpg" alt=""></p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">style</span> <span class="attr">type</span>=<span class="string">"text/css"</span>></span><span class="undefined"></span></span><br><span class="line"><span class="undefined">    /*</span></span><br><span class="line"><span class="undefined">    div p {</span></span><br><span class="line"><span class="undefined">        color: red;</span></span><br><span class="line"><span class="undefined">    }</span></span><br><span class="line"><span class="undefined">    */</span></span><br><span class="line"><span class="css">   <span class="selector-class">.father</span> <span class="selector-tag">p</span> <span class="selector-tag">span</span> {</span></span><br><span class="line"><span class="css">    <span class="selector-tag">color</span><span class="selector-pseudo">:blue</span>;</span></span><br><span class="line"><span class="undefined"></span></span><br><span class="line"><span class="undefined">   }</span></span><br><span class="line"><span class="undefined"></span></span><br><span class="line"><span class="undefined">    </span><span class="tag"></<span class="name">style</span>></span></span><br><span class="line"><span class="tag"></<span class="name">head</span>></span></span><br><span class="line"><span class="tag"><<span class="name">body</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">p</span>></span>张三<span class="tag"></<span class="name">p</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">div</span>></span></span><br><span class="line">        <span class="tag"><<span class="name">p</span>></span>王五<span class="tag"></<span class="name">p</span>></span></span><br><span class="line">    <span class="tag"></<span class="name">div</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">div</span> <span class="attr">class</span>=<span class="string">"father"</span>></span></span><br><span class="line">        <span class="tag"><<span class="name">p</span>></span>马六</span><br><span class="line">            <span class="tag"><<span class="name">span</span>></span>啊啊啊<span class="tag"></<span class="name">span</span>></span></span><br><span class="line"></span><br><span class="line">        <span class="tag"></<span class="name">p</span>></span></span><br><span class="line"></span><br><span class="line">    <span class="tag"></<span class="name">div</span>></span></span><br><span class="line"><span class="tag"></<span class="name">body</span>></span></span><br></pre></td></tr></table></figure>

<h3 id="4-9-选择器的优先级"><a href="#4-9-选择器的优先级" class="headerlink" title="4.9 选择器的优先级"></a>4.9 选择器的优先级</h3><p>前面，我们学习了，标签选择器，类选择器，ID选择器，后代选择器，那么我们来看一下它们的优先级问题。</p>
<p>1、类选择器优先级高于标签选择器。</p>
<p>2、ID选择器优先级高于类选择器，也高于标签选择器。</p>
<p>3、后代选择器，要根据情况确定，与ID选择器结合使用优先级要高于与类选择器结合使用优先级</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">style</span> <span class="attr">type</span>=<span class="string">"text/css"</span>></span><span class="undefined"></span></span><br><span class="line"><span class="css">    <span class="selector-class">.bxg</span>{</span></span><br><span class="line"><span class="undefined">        color: red;</span></span><br><span class="line"><span class="undefined">    }</span></span><br><span class="line"><span class="undefined">    div {</span></span><br><span class="line"><span class="undefined">        color: blue;</span></span><br><span class="line"><span class="undefined">    }</span></span><br><span class="line"><span class="css">    <span class="selector-id">#box</span>{</span></span><br><span class="line"><span class="css">        <span class="selector-tag">color</span><span class="selector-pseudo">:green</span>;</span></span><br><span class="line"><span class="undefined">    }</span></span><br><span class="line"><span class="css">    <span class="selector-tag">div</span> <span class="selector-class">.bxg</span>{</span></span><br><span class="line"><span class="css">            <span class="selector-tag">color</span><span class="selector-pseudo">:orange</span></span></span><br><span class="line"><span class="undefined">    }</span></span><br><span class="line"><span class="undefined">    </span><span class="tag"></<span class="name">style</span>></span></span><br><span class="line"><span class="tag"></<span class="name">head</span>></span></span><br><span class="line"><span class="tag"><<span class="name">body</span>></span></span><br><span class="line">   <span class="tag"><<span class="name">div</span>></span></span><br><span class="line">        <span class="tag"><<span class="name">div</span> <span class="attr">id</span>=<span class="string">"box"</span> <span class="attr">class</span>=<span class="string">"bxg"</span> ></span>博学谷线上平台<span class="tag"></<span class="name">div</span>></span></span><br><span class="line">    <span class="tag"></<span class="name">div</span>></span></span><br><span class="line"><span class="tag"></<span class="name">body</span>></span></span><br><span class="line"><span class="tag"></<span class="name">html</span>></span></span><br></pre></td></tr></table></figure>

<h2 id="5、块级标签显示模式"><a href="#5、块级标签显示模式" class="headerlink" title="5、块级标签显示模式"></a>5、块级标签显示模式</h2><h3 id="5-1、块级元素-block-level-（重点）"><a href="#5-1、块级元素-block-level-（重点）" class="headerlink" title="5.1、块级元素(block-level)（重点）"></a>5.1、块级元素(block-level)（重点）</h3><p>每个块元素通常都会独自占据一整行或多整行，可以对其设置宽度、高度、对齐等属性，常用于网页布局和网页结构的搭建。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">常见的块元素有<h1>~<h6>、<p>、<div>、等，其中<div>标签是最典型的块元素。</span><br></pre></td></tr></table></figure>

<p>块级元素非常适合布局(可以打开某个网站，看一下其对应的布局)，所以我们常说DIV+CSS</p>
<p>块级元素的特点：</p>
<p>（1）总是从新行开始</p>
<p>（2）高度，行高、外边距以及内边距都可以控制。</p>
<p>（3）宽度默认是容器的100%</p>
<p>（4）可以容纳内联元素（行内元素）和其他块元素。</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">meta</span> <span class="attr">charset</span>=<span class="string">"UTF-8"</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">title</span>></span>块级元素<span class="tag"></<span class="name">title</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">style</span> <span class="attr">type</span>=<span class="string">"text/css"</span>></span><span class="undefined"></span></span><br><span class="line"><span class="undefined">    div {</span></span><br><span class="line"><span class="undefined">        background-color: orange;</span></span><br><span class="line"><span class="undefined">        width: 500px;</span></span><br><span class="line"><span class="undefined">        height: 200px;</span></span><br><span class="line"><span class="undefined">    }</span></span><br><span class="line"><span class="undefined">    </span><span class="tag"></<span class="name">style</span>></span></span><br><span class="line"><span class="tag"></<span class="name">head</span>></span></span><br><span class="line"><span class="tag"><<span class="name">body</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">div</span>></span>张三<span class="tag"></<span class="name">div</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">div</span>></span>王五<span class="tag"></<span class="name">div</span>></span></span><br><span class="line"><span class="tag"></<span class="name">body</span>></span></span><br><span class="line"><span class="tag"></<span class="name">html</span>></span></span><br></pre></td></tr></table></figure>

<h3 id="5-2、行内元素-inline-level-（重点）"><a href="#5-2、行内元素-inline-level-（重点）" class="headerlink" title="5.2、行内元素(inline-level)（重点）"></a>5.2、行内元素(inline-level)（重点）</h3><p>行内元素（内联元素）不占有独立的区域，仅仅靠自身的字体大小和图像尺寸来支撑结构，一般不可以设置宽度、高度、对齐等属性，常用于控制页面中文本的样式。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">常见的行内元素有<a>、<strong>、<b>、<em>、<i>、<del>、<s>、<ins>、<u>、<span>等，其中<span>标签最典型的行内元素。</span><br></pre></td></tr></table></figure>

<p>行内元素的特点：</p>
<p>（1）和相邻行内元素在一行上。</p>
<p>（2）高、宽无效，但水平方向的padding和margin可以设置，垂直方向的无效。</p>
<p>（3）默认宽度就是它本身内容的宽度。</p>
<p>（4）行内元素只能容纳文本或则其他行内元素。（a特殊）</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">style</span> <span class="attr">type</span>=<span class="string">"text/css"</span>></span><span class="undefined"></span></span><br><span class="line"><span class="undefined">        span{</span></span><br><span class="line"><span class="undefined">            background-color: orange;</span></span><br><span class="line"><span class="undefined">            width: 200px;</span></span><br><span class="line"><span class="css">            <span class="selector-tag">height</span>: 300<span class="selector-tag">px</span>; <span class="comment">/*高度与宽度不起作用*/</span></span></span><br><span class="line"><span class="undefined">        }</span></span><br><span class="line"><span class="undefined"></span></span><br><span class="line"><span class="undefined">    </span><span class="tag"></<span class="name">style</span>></span></span><br><span class="line"><span class="tag"></<span class="name">head</span>></span></span><br><span class="line"><span class="tag"><<span class="name">body</span>></span></span><br><span class="line"><span class="comment"><!-- 默认宽度就是它本身内容的宽度。 --></span></span><br><span class="line">    <span class="tag"><<span class="name">span</span>></span>张三是一个好人<span class="tag"></<span class="name">span</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">span</span>></span>李四<span class="tag"></<span class="name">span</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">span</span>></span>王五<span class="tag"></<span class="name">span</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">p</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">div</span>></span>马六<span class="tag"></<span class="name">div</span>></span></span><br><span class="line">    <span class="tag"></<span class="name">p</span>></span></span><br><span class="line"><span class="tag"></<span class="name">body</span>></span></span><br><span class="line"><span class="tag"></<span class="name">html</span>></span></span><br></pre></td></tr></table></figure>

<p>注意：</p>
<ol>
<li>只有 文字才 能组成段落  因此 p  里面不能放块级元素，同理还有这些标签h1,h2,h3,h4,h5,h6他们都是文字类块级标签，里面不能放其他块级元素。例如，不能在p标签中添加添加div标签。</li>
<li>链接里面不能再放链接。</li>
</ol>
<h3 id="5-3、块级元素和行内元素区别（重点）"><a href="#5-3、块级元素和行内元素区别（重点）" class="headerlink" title="5.3、块级元素和行内元素区别（重点）"></a>5.3、块级元素和行内元素区别（重点）</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">块级元素的特点：</span><br><span class="line">（1）总是从新行开始</span><br><span class="line">（2）高度，行高、外边距以及内边距都可以控制。</span><br><span class="line">（3）宽度默认是容器的100%</span><br><span class="line">（4）可以容纳内联元素和其他块元素。</span><br></pre></td></tr></table></figure>

<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">行内元素的特点：</span><br><span class="line">（1）和相邻行内元素在一行上。</span><br><span class="line">（2）高、宽无效，但水平方向的padding和margin可以设置，垂直方向的无效。</span><br><span class="line">（3）默认宽度就是它本身内容的宽度。</span><br><span class="line">（4）行内元素只能容纳文本或则其他行内元素。</span><br></pre></td></tr></table></figure>

<h3 id="5-4-、行内块元素（inline-block）（了解）"><a href="#5-4-、行内块元素（inline-block）（了解）" class="headerlink" title="5.4 、行内块元素（inline-block）（了解）"></a>5.4 、行内块元素（inline-block）（了解）</h3><p>在行内元素中有几个特殊的标签——<img>、<input>、<td>，可以对它们设置宽高和对齐属性，有些资料可能会称它们为行内块元素。</td></p>
<p>行内块元素的特点：<br>（1）和相邻行内元素（行内块）在一行上,但是之间会有空白缝隙。<br>（2）默认宽度就是它本身内容的宽度。<br>（3）高度，行高、外边距以及内边距都可以控制。</p>
<p> 行内块元素既有块级元素的特点，又有行内元素的特定。</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">    <span class="tag"><<span class="name">title</span>></span> 行内块元素<span class="tag"></<span class="name">title</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">style</span> <span class="attr">type</span>=<span class="string">"text/css"</span>></span><span class="undefined"></span></span><br><span class="line"><span class="undefined"></span></span><br><span class="line"><span class="undefined">    input {</span></span><br><span class="line"><span class="undefined">        width: 300px;</span></span><br><span class="line"><span class="undefined">        height: 20px;</span></span><br><span class="line"><span class="undefined">    }</span></span><br><span class="line"><span class="undefined">    </span><span class="tag"></<span class="name">style</span>></span></span><br><span class="line"><span class="tag"></<span class="name">head</span>></span></span><br><span class="line"><span class="tag"><<span class="name">body</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">input</span> <span class="attr">type</span>=<span class="string">"text"</span> <span class="attr">name</span>=<span class="string">"userName"</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">input</span> <span class="attr">type</span>=<span class="string">"text"</span> <span class="attr">name</span>=<span class="string">"userEmail"</span>></span></span><br><span class="line"><span class="tag"></<span class="name">body</span>></span></span><br></pre></td></tr></table></figure>

<h3 id="5-5、-标签显示模式转换-display"><a href="#5-5、-标签显示模式转换-display" class="headerlink" title="5.5、 标签显示模式转换 display"></a>5.5、 标签显示模式转换 display</h3><p>##</p>
<p>块转行内：display:inline;</p>
<p>行内转块：display:block;</p>
<p>块、行内元素转换为行内块： display: inline-block;</p>
<p>此阶段，我们只需关心这三个，其他的是我们后面的工作。</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">    <span class="tag"><<span class="name">title</span>></span>标签显示模式转换 display<span class="tag"></<span class="name">title</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">style</span> <span class="attr">type</span>=<span class="string">"text/css"</span>></span><span class="undefined"></span></span><br><span class="line"><span class="undefined">    div {</span></span><br><span class="line"><span class="css">        <span class="selector-tag">display</span>: <span class="selector-tag">inline</span>; <span class="comment">/*将块级元素转换成行内元素显示模式*/</span></span></span><br><span class="line"><span class="undefined">    }</span></span><br><span class="line"><span class="undefined">    span {</span></span><br><span class="line"><span class="css">        <span class="selector-tag">display</span>: <span class="selector-tag">block</span>; <span class="comment">/*将行内元素转换成块级元素显示模式*/</span></span></span><br><span class="line"><span class="undefined">    }</span></span><br><span class="line"><span class="undefined">    a {</span></span><br><span class="line"><span class="undefined">        background-color: orange;</span></span><br><span class="line"><span class="css">        <span class="selector-tag">width</span><span class="selector-pseudo">:100px</span>;</span></span><br><span class="line"><span class="css">        <span class="selector-tag">height</span><span class="selector-pseudo">:30px</span>; <span class="comment">/*a标签是行内元素，所以宽高无效，但是我们在后期网页设计中经常来控制a标签的高度与宽度，所以在这里我们可以转换成行内块元素的显示模式*/</span></span></span><br><span class="line"><span class="css">        <span class="selector-tag">display</span><span class="selector-pseudo">:inline-block</span>;</span></span><br><span class="line"><span class="undefined">    }</span></span><br><span class="line"><span class="undefined"></span></span><br><span class="line"><span class="undefined">    </span><span class="tag"></<span class="name">style</span>></span></span><br><span class="line"><span class="tag"></<span class="name">head</span>></span></span><br><span class="line"><span class="tag"><<span class="name">body</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">div</span>></span>张三<span class="tag"></<span class="name">div</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">div</span>></span>李四<span class="tag"></<span class="name">div</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">div</span>></span>王五<span class="tag"></<span class="name">div</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">span</span>></span>123<span class="tag"></<span class="name">span</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">span</span>></span>456<span class="tag"></<span class="name">span</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">span</span>></span>780<span class="tag"></<span class="name">span</span>></span></span><br><span class="line"></span><br><span class="line">    <span class="tag"><<span class="name">a</span> <span class="attr">href</span>=<span class="string">"#"</span>></span>abc<span class="tag"></<span class="name">a</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">a</span> <span class="attr">href</span>=<span class="string">"#"</span>></span>def<span class="tag"></<span class="name">a</span>></span></span><br><span class="line">    <span class="tag"><<span class="name">a</span> <span class="attr">href</span>=<span class="string">"#"</span>></span>hig<span class="tag"></<span class="name">a</span>></span></span><br><span class="line">    <span class="tag"></<span class="name">body</span>></span></span><br><span class="line"><span class="tag"></<span class="name">html</span>></span></span><br></pre></td></tr></table></figure>

</body></title></body></html>
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/前端/" rel="tag"># 前端</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2019/03/24/路由器刷固件/" rel="next" title="路由器刷固件">
                <i class="fa fa-chevron-left"></i> 路由器刷固件
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2019/05/01/CSS/" rel="prev" title="CSS">
                CSS <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
    </div>
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="/images/touxiang.jpg"
                alt="GodPang" />
            
              <p class="site-author-name" itemprop="name">GodPang</p>
              <p class="site-description motion-element" itemprop="description">一只一直在努力的胖子</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives">
              
                  <span class="site-state-item-count">23</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">11</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/GodPang" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.jianshu.com/u/c8a45218e240" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-book"></i>简书</a>
                  </span>
                
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-block">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                Links
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="https://lengjibo.github.io/" title="冷逸" target="_blank">冷逸</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://test482.github.io" title="Eliot's Blog" target="_blank">Eliot's Blog</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://prontosil.club/" title="百浪多息" target="_blank">百浪多息</a>
                  </li>
                
              </ul>
            </div>
          

          <div id="music163player">
    <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=38592976&auto=1&height=66"></iframe>
</div>

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#null"><span class="nav-number">1.</span> <span class="nav-text">我挺可怜昨晚那个男生的，毕竟我曾经和他一样无助</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1、什么是HTML语言"><span class="nav-number"></span> <span class="nav-text">1、什么是HTML语言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、网页创建"><span class="nav-number"></span> <span class="nav-text">2、网页创建</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#2-1-常用工具"><span class="nav-number">1.</span> <span class="nav-text">2.1 常用工具</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-2-Html基本结构"><span class="nav-number">2.</span> <span class="nav-text">2.2  Html基本结构</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-3-标签关系"><span class="nav-number">3.</span> <span class="nav-text">2.3 标签关系</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-4-文档类型-lt-DOCTYPE-gt"><span class="nav-number">4.</span> <span class="nav-text">2.4  文档类型</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-5-字符集"><span class="nav-number">5.</span> <span class="nav-text">2.5 字符集</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#二、HTML常用标签"><span class="nav-number"></span> <span class="nav-text">二、HTML常用标签</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、排版标签"><span class="nav-number"></span> <span class="nav-text">1、排版标签</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1-标题标签-熟记"><span class="nav-number">1.</span> <span class="nav-text">1.1 标题标签 (熟记)</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#null"><span class="nav-number"></span> <span class="nav-text">、、、、和</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#null"><span class="nav-number"></span> <span class="nav-text">、、、和</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#null"><span class="nav-number">1.</span> <span class="nav-text">、、和</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#null"><span class="nav-number">1.1.</span> <span class="nav-text">、和</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#null"><span class="nav-number">1.1.1.</span> <span class="nav-text">和</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#null"><span class="nav-number">1.1.1.1.</span> <span class="nav-text"></span></a></li></ol></li></ol></li></ol></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#null"><span class="nav-number"></span> <span class="nav-text">用来修饰网页的主标题，表示一个段落的标题，表示段落的小节标题</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#null"><span class="nav-number"></span> <span class="nav-text">表示一个段落的标题，表示段落的小节标题</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#null"><span class="nav-number">1.</span> <span class="nav-text">表示段落的小节标题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-2-段落标签-熟记"><span class="nav-number">2.</span> <span class="nav-text">1.2 段落标签( 熟记)</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-水平线标签-认识"><span class="nav-number">3.</span> <span class="nav-text">1.3 水平线标签(认识)</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#1-3-1-标签属性"><span class="nav-number">3.1.</span> <span class="nav-text">1.3.1 标签属性</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-4-HTML标签分类"><span class="nav-number">4.</span> <span class="nav-text">1.4  HTML标签分类</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-5-换行标签-熟记"><span class="nav-number">5.</span> <span class="nav-text">1.5 换行标签(熟记)</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-6-div-span标签-重点"><span class="nav-number">6.</span> <span class="nav-text">1.6 div span标签(重点)</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、HTML标签的语义化"><span class="nav-number"></span> <span class="nav-text">2、HTML标签的语义化</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#为什么要有语义化标签"><span class="nav-number">1.</span> <span class="nav-text">为什么要有语义化标签</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3、文本格式化标签-熟记"><span class="nav-number"></span> <span class="nav-text">3、文本格式化标签(熟记)</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4、图像标签img-重点"><span class="nav-number"></span> <span class="nav-text">4、图像标签img (重点)</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#三、路径-重点、难点"><span class="nav-number"></span> <span class="nav-text">三、路径(重点、难点)</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、相对路径"><span class="nav-number"></span> <span class="nav-text">1、相对路径</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、绝对路径"><span class="nav-number"></span> <span class="nav-text">2、绝对路径</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#四、链接标签-重点"><span class="nav-number"></span> <span class="nav-text">四、链接标签(重点)</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、base-标签"><span class="nav-number"></span> <span class="nav-text">1、base 标签</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、锚点定位-（难点）"><span class="nav-number"></span> <span class="nav-text">2、锚点定位 （难点）</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#五：CSS样式"><span class="nav-number"></span> <span class="nav-text">五：CSS样式</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、CSS初识"><span class="nav-number"></span> <span class="nav-text">1、CSS初识</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、CSS-网页的美容师"><span class="nav-number"></span> <span class="nav-text">2、CSS 网页的美容师</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3、CSS样式规则"><span class="nav-number"></span> <span class="nav-text">3、CSS样式规则</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-选择器（重点）"><span class="nav-number"></span> <span class="nav-text">4:选择器（重点）</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#4-1-标签选择器（元素选择器）"><span class="nav-number">1.</span> <span class="nav-text">4.1 标签选择器（元素选择器）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-2-类选择器"><span class="nav-number">2.</span> <span class="nav-text">4.2 类选择器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-3-选择器命名规范"><span class="nav-number">3.</span> <span class="nav-text">4.3  选择器命名规范</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-4-ID选择器"><span class="nav-number">4.</span> <span class="nav-text">4.4 ID选择器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-5-类选择器与ID选择器区别"><span class="nav-number">5.</span> <span class="nav-text">4.5 类选择器与ID选择器区别</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-6-通配符选择器"><span class="nav-number">6.</span> <span class="nav-text">4.6 通配符选择器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-7-案例"><span class="nav-number">7.</span> <span class="nav-text">4.7 案例</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-8-后代选择器"><span class="nav-number">8.</span> <span class="nav-text">4.8 后代选择器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-9-选择器的优先级"><span class="nav-number">9.</span> <span class="nav-text">4.9 选择器的优先级</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5、块级标签显示模式"><span class="nav-number"></span> <span class="nav-text">5、块级标签显示模式</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#5-1、块级元素-block-level-（重点）"><span class="nav-number">1.</span> <span class="nav-text">5.1、块级元素(block-level)（重点）</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#null"><span class="nav-number"></span> <span class="nav-text">~、、、等，其中标签是最典型的块元素。</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#null"><span class="nav-number">0.0.0.1.</span> <span class="nav-text">、、、等，其中标签是最典型的块元素。</span></a></li></ol></li></ol></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-2、行内元素-inline-level-（重点）"><span class="nav-number">1.</span> <span class="nav-text">5.2、行内元素(inline-level)（重点）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-3、块级元素和行内元素区别（重点）"><span class="nav-number">2.</span> <span class="nav-text">5.3、块级元素和行内元素区别（重点）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-4-、行内块元素（inline-block）（了解）"><span class="nav-number">3.</span> <span class="nav-text">5.4 、行内块元素（inline-block）（了解）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-5、-标签显示模式转换-display"><span class="nav-number">4.</span> <span class="nav-text">5.5、 标签显示模式转换 display</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>
    


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 2018 &mdash; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">GodPang</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a> v5.1.4</div>



  <div class="footer-custom">Hosted by <a target="_blank" rel="external nofollow" href="https://pages.github.com/">GitHub Pages</a></div>


        
<div class="busuanzi-count">
  <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      
    </span>
  
</div>








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  










  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  <script src="//unpkg.com/valine/dist/Valine.min.js"></script>
  
  <script type="text/javascript">
    var GUEST = ['nick','mail','link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item=>{
      return GUEST.indexOf(item)>-1;
    });
    new Valine({
        el: '#comments' ,
        verify: false,
        notify: false,
        appId: 'RAQiIXnddbLLbBRiBcDuJo3j-gzGzoHsz',
        appKey: 'rhBtL6nW6zYrDqLcVsPX4M51',
        placeholder: '大佬勿喷，文明交流',
        avatar:'mm',
        guest_info:guest,
        pageSize:'10' || 10,
    });
  </script>



  





  

  

  

  
  

  

  

  

<!-- 页面点击小红心 -->
<script type="text/javascript" src="/js/src/clicklove.js"></script>

</body>
</html>
